import { useRef } from "react";

function UserRef() {
    const userRef = useRef(null);

    const handelUserRef = () => {
        console.log("input中的值是",userRef.current.value);
    }
    return (
        <div>
            <input type="text" name="username" ref={userRef} onKeyUp={handelUserRef}/> userRef测试
        </div>
    )
}

export default UserRef;